﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class View_CIB_CIB_Deposit_1 : ViewMatrix
{
    string[] calFields = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        
        criteriaList = new string[] { "Criteria", "ym" ,"option"};
        Title = "存款分析表";
        serviceName = "MISAPP.Classify.Service.Service_CIB_Deposit";
        btn2Excel.PageParameter = "method=GetSummaryData&xls=CIB_Deposit&service=Service_CIB_Deposit";
        System.Reflection.MethodInfo mi = GetObjectMethodInfo("GetCalFields");
        calFields = mi.Invoke(Instance, null) as string[];
        if (!IsPostBack)
        {
            GetData();
        }        
    }

    protected void GetData()
    {
        System.Data.DataTable dt = GetDataFromSerevice("GetSummaryData");
        CLB_Summary.SetData(dt, new string[] { });
    }

    protected void CLB_Summary_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            var result = from cf in calFields
                         where e.Row.Cells[0].Text.Equals(cf)
                         select cf;
            if (result.Count() > 0)
            {
                e.Row.CssClass = "diff";
            }
        }
    }
    protected void GV1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GetData();
    }

    protected void btn2Excel_Click(object sender, EventArgs e)
    {
        FillToSession();
    }

    protected void previous_click(object sender, EventArgs e)
    {
        Utility.SessionClear();
    }
}
